package org.toycode.serviceloader.demo;

import java.util.Iterator;
import java.util.ServiceLoader;
import org.toycode.serviceloader.demo.spi.ServiceProviderInterface;

/**
 *
 * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
 * @version 1.0.0.0, Sep 16, 2009
 */
public class Main {

    private static ServiceLoader<ServiceProviderInterface> serviceLoader =
            ServiceLoader.load(ServiceProviderInterface.class);

    public static void main(String[] args) {
        final Iterator<ServiceProviderInterface> iterator =
                serviceLoader.iterator();

        while (iterator.hasNext()) {
            iterator.next().serviceA();
        }

    }
}
